<pw:html>
    <pw:head>
        <title>{$entity->singular} view</title>

        <pw:component name="pw_include_view" data-show="true" data-src="head_scripts.html"></pw:component>
    </pw:head>

    <pw:body>

        <pw:component name="pw_include_view" data-show="true" data-src="header.html"></pw:component>

        <div class="container">

                <pw:component name="pw_include_view" data-show="true" data-src="messages.html"></pw:component>
                
                <pw:component name="pw_div" data-show="true" data-class="row" data-id="">
                    <pw:container>

                        <pw:component name="pw_div" data-show="true" data-class="span2" data-id="">
                            <pw:container>
                                <pw:component name="pw_include_view" data-show="true" data-src="sample_sidebar.html"></pw:component>
                            </pw:container>
                        </pw:component>

                         <pw:component name="pw_div" data-show="true" data-class="span10" data-id="">
                            <pw:container>
                                <pw:component name="pw_text" data-show="true" data-content="{$entity->singular|capitalize} view" data-tag="legend" data-free=""></pw:component>
                                {foreach from=$entity->attribute item="attribute"}
                                  {$attribute->getTemplate('readComponent')}
                                {/foreach}

                                {foreach from=$entity->getHasOne() item="oneRelated"}
                                <pw:component name='pw_item' data-show="true" data-label='{$oneRelated->singular}' data-value='{literal}{${/literal}{$entity->singular}{literal}->{/literal}{$oneRelated->singular}{literal}->{/literal}{$oneRelated->attribute->name}{literal}}{/literal}'></pw:component>
                                {/foreach}

                                {foreach from=$entity->getHasManyToMany() item="manyRelated"}
                                <pw:component name='pw_item' data-show="true" data-label='{$manyRelated->plural}' data-value='{literal}{foreach from=${/literal}{$entity->singular}->{$manyRelated->singular} item="{$manyRelated->singular}" name={$manyRelated->plural}{literal}}{if $smarty.foreach.{/literal}{$manyRelated->plural}{literal}.first}{${/literal}{$manyRelated->singular}->{$manyRelated->attribute->name}{literal}}{else}, {${/literal}{$manyRelated->singular}->{$manyRelated->attribute->name}{literal}}{/if}{/foreach}{/literal}
                                '></pw:component>
                                {/foreach}
                             </pw:container>
                        </pw:component> <!-- .span10 -->

                    </pw:container>
                </pw:component> <!-- .row -->

                <pw:component name="pw_include_view" data-show="true" data-src="footer.html"></pw:component>

        </div><!-- .container -->

        <pw:component name="pw_include_view" data-show="true" data-src="footer_scripts.html"></pw:component>
        
    </pw:body>
</pw:html>